package com.platform.qujia.pay;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.platform.qujia.enums.PaymentPlatformTypeEnum;
import com.platform.qujia.pay.service.PaymentStrategy;
import com.platform.qujia.pay.service.impl.TianQuetechPay;
import com.platform.qujia.utils.sxfpay.SXFPayUtil;
import com.alibaba.fastjson.JSONObject;


/**
 * 支付类的开始
 * @author adminLiu
 *
 */
public class Payment {

	private static Logger logger =(Logger) LoggerFactory.getLogger(Payment.class);
	
	private PaymentStrategy paymentStrategy;
	
	public void setPaymentStrategy(PaymentStrategy paymentStrategy) {
		this.paymentStrategy=paymentStrategy;
	}
	
	/**
	 * 支付初始接口
	 */
    public String performPayment() {
        if (paymentStrategy == null) {
        	logger.info("支付对象为null，不调用支付接口");
        	return null;
        }
        return paymentStrategy.pay();
    }
	
	/**
	 * 支付订单查询
	 */
    public String tradeQueryOrder() {
        if (paymentStrategy == null) {
        	logger.info("支付对象为null，不调用查询接口");
        	return null;
        }
        return paymentStrategy.tradeQueryOrder();
    }
    
}
